{% extends "base/front_base.html" %}
{% load payinfo_filters %}

{% block title %}
    付费
{% endblock %}

{% block head %}
    <link rel="stylesheet" href="{% static 'css/payinfo/payinfo_index.min.css'%}">

{% endblock %}


{% block main %}
    <div class="main">
        <!--内嵌盒子-->
        <div class="wrapper">
            <!--新闻模块主题-->
            <div class="main-content-wrapper">
                <div class="advertise-group">
                    <a href="#">
                        <img src="http://www.xfz.cn/static/build/images/web-venture-banner.png" alt="">
                    </a>
                </div>

                <ul class="document-list">
                    {% for payinfo in payinfos %}
                        <li>
                        {% with payinfo|is_buyed:user as buyed %}
                            {% if buyed %}
                                <a href="{% url 'payinfo:download' %}?payinfo_id={{ payinfo.pk }}">

                            {% else %}
                                <a href="{% url 'payinfo:payinfo_order' %}?payinfo_id={{ payinfo.pk }}">

                            {% endif %}


                                <div class="category-group">
                                </div>
                                <div class="document-info">
                                    <p class="document-title">{{ payinfo.title }}</p>
                                    <p class="document-desc">{{ payinfo.profile }}</p>
                                    <p class="document-price pay">
                                        {% if buyed %}
                                            点击下载
                                        {% else %}
                                            ￥{{ payinfo.price }}
                                        {% endif %}
                                    </p>
                                </div>
                            </a>
                        {% endwith %}

                    </li>

                    {% endfor %}

                </ul>
            </div>
              <!-- 侧边栏盒子-->
            {% include "common/sidebar.html" %}

        </div>

    </div>
{% endblock %}